{extend name="Public/content"/}
{block name="button"}
<button type="button" class="layui-btn layui-btn-sm" id="import">Excel导入</button>
<button class="layui-btn layui-btn-sm" data-title="添加单号" data-modal="{:U('add')}">添加单号</button>
<button data-update data-field='delete' data-action='{:U("del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除记录</button>
{/block}
{block name='content'}

<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:U()}" onsubmit="return false" method="get">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">关键词</label>
        <div class="layui-input-inline">
            <input name="key" value="{$Think.get.key|default=''}" placeholder="请输入文章关键词" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>
<!-- 表单搜索 结束 -->

{empty name='list'}
<p class="help-block text-center well">没 有 记 录 哦！</p>
{else/}
<form class="layui-form" action="__SELF__" data-auto="true" method="post">
    <input type="hidden" name="action" value="resort">
    <table class="layui-table layui-form" lay-size='sm' lay-skin="line">
        <thead>
            <tr>
                <th class='list-table-check-td'>
                    <input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose">
                </th>
                <th class="text-left">序号</th>
                <th class="text-left">快递单号</th>
                <th class="text-left">国家</th>
                <th class="text-left">价格</th>
                <th class="text-left">单号类别</th>
                <th class="text-left">出售状态</th>
                <th class="text-left">单号状态</th>
                <th class="text-left">上网时间</th>
                <th class="text-left">上传时间</th>
                <th></th>
            </tr> 
        </thead>
        <tbody>
            {volist name="list" id="vo" key='key'}
            <tr>
                <td class='list-table-check-td'>
                    <input type="checkbox" value="{$vo.id}" class="list-check-box" lay-skin="primary" lay-filter="itemChoose">
                </td>
                <td class="text-left">{$key+$start}</td>
                <td class="text-left">{$vo.coding}</td>
                <td class="text-left">{$vo.state}</td>
                <td class="text-left">{$vo.price}</td>
                <td class="text-left">{$vo.category}</td>
                <td class="text-left">
                    {eq name='vo.status' value='0'}<span class="color-red">未出售</span>{/eq}
                    {eq name='vo.status' value='1'}<span class="color-green">已出售</span>{/eq}
                </td>
                <td class="text-left">
                    {$vo.coding_status}
                </td>
                <td class="text-left">{gt name='vo.internet_time' value='0'}{$vo.internet_time|date='Y-m-d H:i:s',###}{/gt}</td>
                <td class="text-left">{$vo.add_time|date='Y-m-d H:i:s',###}</td>
                <td>
                    <a data-title="编辑单号" data-modal="{:U('edit')}?id={$vo.id}">编辑</a>
                    <span class="text-explode">|</span>
                    <a data-update="{$vo.id}" data-field="delete" data-action="{:U('del')}">删除</a>
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
</form>
{if condition="isset($page)"}<p>{$page}</p>{/if}
{/empty}
<script>
    layui.upload.render({
        elem: '#import'
        , url: "{:U('upload')}"
        , exts: 'xls|xlsx'
        , accept: 'file'
        , before: function () {
            layer.msg('上传中，请稍候...', {
                icon: 16
                , shade: 0.2
                , time: 300000
            });
        }
        , done: function (res) {
            $.msg.auto(res);
        }
    });
</script>
{/block}